import { Component } from "@xuekl/cli-core/enums"
import * as c from "@xuekl/cli-core/components"
import { BaseForm } from "@xuekl/cli-core/builder"

export default class Post extends BaseForm {
    postId = ''
    postName = ''
    postCode = ''
    postSort = 0
    status = '0'
    remark = ''

    clear(): void {
        this.setForm(new Post(this.opts))
        this.resetFields()
    }

    getPostName(): c.Input {
        return {
            type: Component.Input,
            label: '岗位名称',
            required: true,
            element: {
            }
        }
    }

    getPostCode(): c.Input {
        return {
            type: Component.Input,
            label: '岗位编码',
            required: true,
            element: {
            }
        }
    }

    getPostSort(): c.InputNumber {
        return {
            type: Component.InputNumber,
            label: '岗位顺序',
        }
    }

    getStatus(): c.Radio {
        return {
            type: Component.Radio,
            label: '岗位状态',
            config: {
                dict: 'sys_normal_disable'
            }
        }
    }

    getRemark(): c.Textarea {
        return {
            type: Component.Textarea,
            label: '备注',
        }
    }
}
